package ACM.meituan;

/**
 * @Author wwk
 * @DATE 2022/8/20 11:43
 */
import  java.util.*;
import java.text.DecimalFormat;
public class fifth {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();  //>=1
        int m = scanner.nextInt();  // >=1

        int[] A = new int[n];
        int[] B = new int[m];
        for (int i = 0; i < n; i++) {
            A[i] = scanner.nextInt();
        }
        for (int i = 0; i < m; i++) {
            B[i] = scanner.nextInt();
        }
        Arrays.sort(A);
        Arrays.sort(B);
        //数量不够
        if(A[0] > B[0] ){
            System.out.println(-1);
            return;
        }
        //数量够
        int res = 0;
        for(int i = 0; i < n; i++) {
            for(int j = 0; j < m; j++) {
                if(B[i] > A[i]){
                    res += B[i];
                    continue;
                }
            }
        }
        System.out.println(res);





    }
}
